
import { _decorator, Component,Animation, Node, SpriteFrame, AnimationClip } from 'cc';
import { FSM_PARAM_TYPE_ENUM, PARAMS_NAME_ENUM } from '../Enum';
import State from './State';
import { StateMechine } from './StateMechine';
const { ccclass, property } = _decorator;




@ccclass('SubStateMechine')
export abstract class SubStateMechine  {
    private _currenState:State = null
    stateMachines:Map<string,State> = new Map();


    constructor(public fsm:StateMechine){

    }
    get currenState(){
        return this._currenState;

    }

    set currenState(newState :State){
        if (!newState) {
            return
        }
        this._currenState = newState;
        this._currenState.run()
    }

   abstract run();
}


